package model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@NamedQueries( { @NamedQuery(name = "JefeOperaciones.findAll", query = "select o from JefeOperaciones o") })
@Table(name = "JEFE_OPERACIONES")
public class JefeOperaciones implements Serializable {
    @Column(nullable = false, length = 20)
    private String password;
    @Id
    @Column(name = "RUT_JO", nullable = false, length = 10, insertable = false, updatable = false)
    private String rutJo;
    @ManyToOne
    @JoinColumn(name = "RUT_JO")
    private Personal personal3;

    public JefeOperaciones() {
    }

    public JefeOperaciones(String password, Personal personal3) {
        this.password = password;
        this.personal3 = personal3;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getRutJo() {
        return rutJo;
    }

    public void setRutJo(String rutJo) {
        this.rutJo = rutJo;
    }

    public Personal getPersonal3() {
        return personal3;
    }

    public void setPersonal3(Personal personal3) {
        this.personal3 = personal3;
        if (personal3 != null) {
            this.rutJo = personal3.getRut();
        }
    }
}
